package com.zh.login.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Description: 登录首页
 * @ClassName LoginController
 * @date: 2021.02.02 20:05
 * @Author: zhanghang
 */
@Controller
public class LoginController {

    @GetMapping({"/"})
    public ModelAndView toLogin(){
        ModelAndView mv = new ModelAndView();
        mv.setViewName("login");
        return mv;
    }

    @RequestMapping("/index")
    public String index(ModelMap model){
        model.put("message","This is your message");
        return "main";
    }

    @RequestMapping("/toUser")
    public String toUser(ModelMap model){
        return "user";
    }
}
